<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

abstract class CommonController extends Controller
{
//    初始化中间件
    public function __construct()
    {
        $this->middleware('admin.auth');
    }

//    请求成功返回信息
    protected function success($message)
    {
        return response()->json(['message'=>$message,'valid'=>1]);
    }

//    请求失败返回信息
    protected function error($message)
    {
        return response()->json(['message'=>$message,'valid'=>0]);
    }
}
